//
//  MYNewsParentingListCollCell.m
//  MuYing
//
//  Created by tbb on 2019/8/5.
//  Copyright © 2019 TBB. All rights reserved.
//

#import "MYNewsParentingListCollCell.h"

@interface MYNewsParentingListCollCell ()

@end

@implementation MYNewsParentingListCollCell
-(void)layoutSubviews {
    [super layoutSubviews];
    [self.contentView addSubview:self.goodsIcon];
    [self.goodsIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(18);
        make.centerX.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(kNEWS_PARENTING_LIST_IMAGE_H, kNEWS_PARENTING_LIST_IMAGE_H));
    }];
    
    [self.contentView addSubview:self.priceLb];
    [self.priceLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(0);
        make.centerX.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(kNEWS_PARENTING_LIST_IMAGE_H, 20));
    }];

    [self.contentView addSubview:self.titleLb];
    [self.titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.goodsIcon.mas_bottom).mas_equalTo(4);
        make.centerX.mas_equalTo(0);
        make.bottom.mas_greaterThanOrEqualTo(-28);
        make.width.mas_equalTo(kNEWS_PARENTING_LIST_IMAGE_H);
    }];
}
#pragma make -lazy
-(UIImageView *)goodsIcon {
    if (!_goodsIcon) {
        _goodsIcon = [[UIImageView alloc] init];
        _goodsIcon.backgroundColor = kAPPThemeColor;
        _goodsIcon.layer.cornerRadius = 8.0;
        _goodsIcon.clipsToBounds = true;
    }
    return _goodsIcon;
}

-(UILabel *) titleLb {
    if (!_titleLb) {
        _titleLb = [[UILabel alloc] init];
        _titleLb.textAlignment = NSTextAlignmentLeft;
        _titleLb.font = kSystemMedium(12);
        _titleLb.textColor = HexColor(0x686868);
        _titleLb.numberOfLines = 2;
        _titleLb.text = @"---";
    }
    return _titleLb;
}

-(UILabel *) priceLb {
    if (!_priceLb) {
        _priceLb = [[UILabel alloc] init];
        _priceLb.textAlignment = NSTextAlignmentLeft;
        _priceLb.font = kSystemMedium(14);
        _priceLb.textColor = kAPPThemeColor;
        _priceLb.text = @"---";
    }
    return _priceLb;
}
#pragma make -lazy end

@end
